package com.changgou.user.feign;

import com.changgou.user.pojo.User;
import com.changgou.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author tang.qingbo
 * @Date 2020/9/1 22:07
 * @Version 1.0
 */
@RequestMapping("/user")
@FeignClient(name = "user")
public interface UserFeign {
    /**
     * 根据ID查询User数据
     * @param id
     * @return
     */
    @GetMapping("/load/{id}")
    Result<User> findById(@PathVariable String id);

    /**
     * 下单时增加用户积分
     */
    @GetMapping("/points/add")
    Result addUserPoint(@RequestParam("points") Integer points);
}
